package com.greatwqs.wmall.task.provider.controller;

import com.greatwqs.wmall.user.client.service.UserClientService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.constants.LoadbalanceRules;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

/**
 * dubbo test
 *
 * @author wang-qingsong
 */
@Slf4j
@RestController
@RequestMapping(value = "/dubbo-test")
public class DubboController {

    @DubboReference(
            version = "v1",
            loadbalance = LoadbalanceRules.RANDOM
    )
    private UserClientService userClientService;


    @PostMapping(value = "/illegalArgumentException")
    public String illegalArgumentException() {
        throw new IllegalArgumentException("OWN IllegalArgumentException");
    }
}
